#ifndef LOMSTREAMHANDLEMAPHH
#define LOMSTREAMHANDLEMAPHH

namespace lom
{
    class ILomOutgoingHandleMap
    {
    public:
	virtual ~ILomOutgoingHandleMap(){}
	/**
	   This gives an outside entity the chance to intercept
	   handles that are written through the LomValues.
	*/
	virtual THandle worldToStream( THandle worldHandle ) = 0;
    };
    
    class LomIdentityOutgoingHandleMap : public ILomOutgoingHandleMap
    {
    public:
	virtual THandle worldToStream( THandle worldHandle ) { return worldHandle; }
    };
    
    class ILomIncomingHandleMap 
    {
    public:
	virtual ~ILomIncomingHandleMap(){}
	/**
	   This gives an outside entity the chance to intercept the
	   handle loading mechanism and thus dictate an overall
	   stream-handle-translation plan.  This is important because
	   if both sides of the stream are using a simple handle
	   increment scenario then you get handle-id collisions.
	 */
	virtual THandle streamToWorld( THandle streamHandle ) = 0;
    };
    
    class LomIdentityIncomingHandleMap : public ILomIncomingHandleMap
    {
    public:
	virtual THandle streamToWorld( THandle streamHandle ) { return streamHandle; }
    };
}
#endif
